<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Swiper demo</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">

		<!-- Link Swiper's CSS -->
		<link rel="stylesheet" href="Public/layui/ext/swiper/css/swiper.min.css">
		<link rel="stylesheet" href="Public/layui/font-awesome/css/font-awesome.min.css">

		<!-- Demo styles -->
		<style>
			html, body {
				position: relative;
				height: 100%;
			}
			body {
				background: #eee;
				font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
				font-size: 14px;
				color: #000;
				margin: 0;
				padding: 0;
			}
			.swiper-container {
				width: 100%;
				height: 100%;
			}
			.swiper-slide {
				text-align: center;
				font-size: 18px;
				background: #fff;
				/* Center slide text vertically */
				display: -webkit-box;
				display: -ms-flexbox;
				display: -webkit-flex;
				display: flex;
				-webkit-box-pack: center;
				-ms-flex-pack: center;
				-webkit-justify-content: center;
				justify-content: center;
				-webkit-box-align: center;
				-ms-flex-align: center;
				-webkit-align-items: center;
				align-items: center;
			}
			.close {
				font-size: 20px;
				position: absolute;
				right: 10px;
				top: 10px;
				z-index: 999;
				cursor: pointer;
				color: #2794eb;
			}
			.win_max {
				font-size: 20px;
				position: absolute;
				right: 35px;
				top: 10px;
				z-index: 999;
				cursor: pointer;
				color: #2794eb;
			}
		</style>
	</head>
	<body>

		<a onclick="close()" class="close"><i class="fa fa-times" ></i></a>
		<a onclick="win_max()" class="win_max"><i class="fa fa-window-maximize"></i></a>
		<!-- Swiper -->
		<div class="swiper-container">
			<div class="swiper-wrapper">
				<foreach name="file_list" item="file">
					<div class="swiper-slide">						
						<iframe scrolling="no" style="width:100%;height:100%;border:0px;" src="{:U('popup/view',array('sid'=>$file))}"></iframe>						
					</div>
				</foreach>
			</div>
			<!-- Add Pagination -->
			<div class="swiper-pagination"></div>
			<div class="swiper-button-next"></div>
			<div class="swiper-button-prev"></div>
		</div>

		<!-- Swiper JS -->
		<script src="Public/layui/ext/swiper/js/swiper.min.js"></script>
		<script src="Public/layui/layui.js" charset="utf-8"></script>

		<!-- Initialize Swiper -->
		<script>
			var swiper = new Swiper('.swiper-container', {
				pagination : '.swiper-pagination',
				paginationClickable : true,
				nextButton : '.swiper-button-next',
				prevButton : '.swiper-button-prev',
				spaceBetween : 30,
				initialSlide : '{$idx}'
			});

			var index = parent.layer.getFrameIndex(window.name);
			layui.use('jquery', function() {
				$ = layui.jquery;
				$('.close').on('click', function() {
					parent.layer.close(index);
				});
				$('.win_max').on('click', function() {
					if ($(".win_max i").hasClass('fa-window-maximize')) {
						parent.layer.full(index);
						$(".win_max i").removeClass('fa-window-maximize');
						$(".win_max i").addClass('fa-window-restore');
						return false;
					}
					if ($(".win_max i").hasClass('fa-window-restore')) {
						parent.layer.restore(index);
						$(".win_max i").removeClass('fa-window-restore');
						$(".win_max i").addClass('fa-window-maximize');
						return false;
					}
				});
			});

		</script>
	</body>
</html>